package com.example.block_chain.controller.account;

import com.example.block_chain.common.ResponseResult;
import com.example.block_chain.domain.dto.RegisterDto;
import com.example.block_chain.service.account.RegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class RegisterController {

    @Autowired
    private RegisterService registerService;

    @PostMapping("/student/account/register/")
    public ResponseResult register(@RequestBody RegisterDto dto){
        String sNo = dto.getSNo();
        String password = dto.getPassword();
        String confirmedPassword = dto.getConfirmedPassword();
        String name = dto.getSName();
        String sID = dto.getSID();
        String sex = dto.getSSex();
        return registerService.register(sNo,password,confirmedPassword,name,sID,sex);
    }
}
